import React from "react";

const List = ({ list, onDel }) => {
  // const fn = () => {}

  return (
    <ul>
      {list.map((item) => {
        return (
          <li key={item.id}>
            {item.name} - <button onClick={onDel(item.id)}>删除</button>
          </li>
        );
      })}
    </ul>
  );
};

export default List;
